package graphique;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.io.File;
import java.io.IOException;

import javax.swing.JFileChooser;

import application.Utilities;

public class OuvrirListener implements ActionListener {
	public OuvrirListener() {
	}

	@Override
	public void actionPerformed(ActionEvent arg0) {
		JFileChooser chooser = new JFileChooser(new File("."));
		chooser.showOpenDialog(null);
		File f = chooser.getSelectedFile();
		try {
			Principal.image = Utilities.getImageProcessor(f);
		} catch (IOException e) {
			e.printStackTrace();
		}
		Principal.actualiseImage();
		if(f!=null)Principal.original=f;
		
	}
}
